package com.Khan.SocialRescueSys.dao;

import com.Khan.SocialRescueSys.pojo.Force;
import com.Khan.SocialRescueSys.pojo.ProvinceForceCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Khan Liu
 * @date 2022/4/4 10:20
 */
@Mapper
@Repository
public interface ForceDao {
    /**
     * 根据id查询Force,后台展示
     *
     * @param id Force id
     * @return Force
     */
    Force getForce(Long id);

    /**
     * 详情
     *
     * @param id Force id
     * @return Force
     */
    Force getDetailedForce(@Param("id") Long id);

    /**
     * 查询所有Force
     *
     * @return 所有Force
     */
    List<Force> getAllForces();

    /**
     * getByTypeId
     *
     * @param typeId typeId
     * @return List<Force>
     */
    List<Force> getByTypeId(Long typeId);

    /**
     * getByProvinceId
     *
     * @param provinceId provinceId
     * @return List<Force>
     */
    List<Force> getByProvinceId(Long provinceId);

    /**
     * getIndexForce
     *
     * @return List<Force>
     */
    List<Force> getIndexForce();

    /**
     * getSearchForce
     *
     * @param query query语句
     * @return List<Force>
     */
    List<Force> getSearchForce(String query);

    /**
     * searchAllForce
     *
     * @param force force
     * @return List<Force>
     */
    List<Force> searchAllForce(Force force);

    /**
     * saveForce
     *
     * @param force force
     * @return int
     */
    int saveForce(Force force);

    /**
     * updateForce
     *
     * @param force force
     * @return int
     */
    int updateForce(Force force);

    /**
     * deleteForce
     *
     * @param id ForceId
     * @return int
     */
    int deleteForce(Long id);

    int updateForceView(Long id);

    int updateForcePublished(Long id);

    /**
     *getProvinceForceCount
     * */
    List<ProvinceForceCount> getProvinceForceCount();

}
